package org.weso.acota.services;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.weso.acota.to.RequestSuggestionTO;
import org.weso.acota.to.SuggestionTO;

/**
 *
 * @author chema
 */

@Path("/acotaRest")
public class CotaServiceRest {

    private CotaServiceFacade facade;
    public CotaServiceRest(){
        this.facade = new CotaServiceFacadeImpl();
    }
    @GET
    @Path("suggest")
    @Produces({"text/plain", "application/xml", "application/json"})
    public SuggestionTO suggest(@QueryParam("q") String q){
        RequestSuggestionTO request = new RequestSuggestionTO(q);
        return this.facade.suggest(request);

    }
}
